#include <iostream>
#include <sstream>

#include "file.h"
#include "namelister.h"

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        std::cerr << "Usage: " << argv[0] << " filename";
        return -1;
    }

    File file(argv[1]);

    file.ReadToRam();

    NameLister nameLister;

    nameLister.GenerateNameList(file);

    NAMELIST nameList;
    nameList = nameLister.GetNameList();

    for(int i = 0; i < nameList.size(); ++i)
    {
        std::string name;
        name = nameList[i]->GetName();

        UINT pointer;
        pointer = nameList[i]->GetPointer();

        std::string type;
        type = nameList[i]->GetType();

        std::string type2;
        type2 = nameList[i]->GetType2();

        std::string type3;
        type3 = nameList[i]->GetType3();

        std::cout << "Name: \"" << name << "\" at file offset: \"" << pointer << "\"" << std::endl;
        std::cout << "TYPE: \"" << type << "\" TYPE2: \"" << type2 << "\" TYPE3 \"" << type3 << "\"" << std::endl << std::endl;
    }

    return 0;
}
